/*    */ package com.zimbra.cs.service.doc;
/*    */ 
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Account;
/*    */ import com.zimbra.cs.service.mail.MailDocumentHandler;
/*    */ import com.zimbra.cs.service.util.ItemId;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public abstract class DocDocumentHandler
/*    */   extends MailDocumentHandler
/*    */ {
/* 27 */   private static final String[] TARGET_ID_PATH = { "w", "id" };
/* 28 */   private static final String[] TARGET_DOC_ID_PATH = { "doc", "id" };
/* 29 */   private static final String[] TARGET_FOLDER_PATH = { "w", "l" };
/* 30 */   private static final String[] TARGET_DOC_FOLDER_PATH = { "doc", "l" };
/*    */   
/*    */   protected String[] getProxiedIdPath(Element request)
/*    */   {
/* 34 */     String[] path = TARGET_ID_PATH;
/* 35 */     String id = getXPath(request, path);
/* 36 */     if (id == null) {
/* 37 */       path = TARGET_DOC_ID_PATH;
/* 38 */       id = getXPath(request, path);
/*    */     }
/* 40 */     if (id == null) {
/* 41 */       path = TARGET_FOLDER_PATH;
/* 42 */       id = getXPath(request, path);
/*    */     }
/* 44 */     if (id == null) {
/* 45 */       path = TARGET_DOC_FOLDER_PATH;
/* 46 */       id = getXPath(request, path);
/*    */     }
/* 48 */     return path;
/*    */   }
/*    */   
/*    */   protected boolean checkMountpointProxy(Element request) {
/* 52 */     return true;
/*    */   }
/*    */   
/* 55 */   protected String getAuthor(ZimbraSoapContext zsc) throws ServiceException { return getAuthenticatedAccount(zsc).getName(); }
/*    */   
/*    */   protected ItemId getRequestedFolder(Element request, ZimbraSoapContext zsc) throws ServiceException
/*    */   {
/* 59 */     for (Element elem : request.listElements()) {
/* 60 */       String fid = elem.getAttribute("l", null);
/* 61 */       if (fid != null) {
/* 62 */         return new ItemId(fid, zsc);
/*    */       }
/*    */     }
/* 65 */     return null;
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/doc/DocDocumentHandler.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */